3.107 \(\int \cos ^2(a+\frac {1}{2} \sqrt {-\frac {1}{n^2}} \log (c x^n)) \, dx\)

Optimal. Leaf size=68 \[ \frac {1}{8} x e^{-2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{4} x e^{2 a \sqrt {-\frac {1}{n^2}} n} \log (x) \left (c x^n\right )^{-1/n}+\frac {x}{2} \]

[Out]

1/2*x+1/8*x*(c*x^n)^(1/n)/exp(2*a*n*(-1/n^2)^(1/2))+1/4*exp(2*a*n*(-1/n^2)^(1/2))*x*ln(x)/((c*x^n)^(1/n))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {4484, 4490} \[ \frac {1}{8} x e^{-2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{4} x e^{2 a \sqrt {-\frac {1}{n^2}} n} \log (x) \left (c x^n\right )^{-1/n}+\frac {x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + (Sqrt[-n^(-2)]*Log[c*x^n])/2]^2,x]

[Out]

x/2 + (x*(c*x^n)^n^(-1))/(8*E^(2*a*Sqrt[-n^(-2)]*n)) + (E^(2*a*Sqrt[-n^(-2)]*n)*x*Log[x])/(4*(c*x^n)^n^(-1))

Rule 4484

Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[x/(n*(c*x^n)^(1/n)), Subst[Int[x
^(1/n - 1)*Cos[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a, b, c, d, n, p}, x] && (NeQ[c, 1] || NeQ[n,
1])

Rule 4490

Int[Cos[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Dist[1/2^p, Int[ExpandIntegrand[
(e*x)^m*(E^((a*b*d^2*p)/(m + 1))/x^((m + 1)/p) + x^((m + 1)/p)/E^((a*b*d^2*p)/(m + 1)))^p, x], x], x] /; FreeQ
[{a, b, d, e, m}, x] && IGtQ[p, 0] && EqQ[b^2*d^2*p^2 + (m + 1)^2, 0]

Rubi steps

\begin {align*} \int \cos ^2\left (a+\frac {1}{2} \sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx &=\frac {\left (x \left (c x^n\right )^{-1/n}\right ) \operatorname {Subst}\left (\int x^{-1+\frac {1}{n}} \cos ^2\left (a+\frac {1}{2} \sqrt {-\frac {1}{n^2}} \log (x)\right ) \, dx,x,c x^n\right )}{n}\\ &=\frac {\left (x \left (c x^n\right )^{-1/n}\right ) \operatorname {Subst}\left (\int \left (\frac {e^{2 a \sqrt {-\frac {1}{n^2}} n}}{x}+2 x^{-1+\frac {1}{n}}+e^{-2 a \sqrt {-\frac {1}{n^2}} n} x^{-1+\frac {2}{n}}\right ) \, dx,x,c x^n\right )}{4 n}\\ &=\frac {x}{2}+\frac {1}{8} e^{-2 a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{4} e^{2 a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{-1/n} \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 0.12, size = 0, normalized size = 0.00 \[ \int \cos ^2\left (a+\frac {1}{2} \sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[Cos[a + (Sqrt[-n^(-2)]*Log[c*x^n])/2]^2,x]

[Out]

Integrate[Cos[a + (Sqrt[-n^(-2)]*Log[c*x^n])/2]^2, x]

________________________________________________________________________________________

fricas [C]  time = 0.46, size = 57, normalized size = 0.84 \[ \frac {1}{8} \, {\left (x^{2} + 4 \, x e^{\left (\frac {2 i \, a n - \log \relax (c)}{n}\right )} + 2 \, e^{\left (\frac {2 \, {\left (2 i \, a n - \log \relax (c)\right )}}{n}\right )} \log \relax (x)\right )} e^{\left (-\frac {2 i \, a n - \log \relax (c)}{n}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+1/2*log(c*x^n)*(-1/n^2)^(1/2))^2,x, algorithm="fricas")

[Out]

1/8*(x^2 + 4*x*e^((2*I*a*n - log(c))/n) + 2*e^(2*(2*I*a*n - log(c))/n)*log(x))*e^(-(2*I*a*n - log(c))/n)

________________________________________________________________________________________

giac [A]  time = 0.89, size = 1, normalized size = 0.01 \[ +\infty \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+1/2*log(c*x^n)*(-1/n^2)^(1/2))^2,x, algorithm="giac")

[Out]

+Infinity

________________________________________________________________________________________

maple [F]  time = 0.08, size = 0, normalized size = 0.00 \[ \int \cos ^{2}\left (a +\frac {\ln \left (c \,x^{n}\right ) \sqrt {-\frac {1}{n^{2}}}}{2}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+1/2*ln(c*x^n)*(-1/n^2)^(1/2))^2,x)

[Out]

int(cos(a+1/2*ln(c*x^n)*(-1/n^2)^(1/2))^2,x)

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 41, normalized size = 0.60 \[ \frac {c^{\frac {2}{n}} x^{2} \cos \left (2 \, a\right ) + 4 \, c^{\left (\frac {1}{n}\right )} x + 2 \, \cos \left (2 \, a\right ) \log \relax (x)}{8 \, c^{\left (\frac {1}{n}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+1/2*log(c*x^n)*(-1/n^2)^(1/2))^2,x, algorithm="maxima")

[Out]

1/8*(c^(2/n)*x^2*cos(2*a) + 4*c^(1/n)*x + 2*cos(2*a)*log(x))/c^(1/n)

________________________________________________________________________________________

mupad [B]  time = 2.71, size = 86, normalized size = 1.26 \[ \frac {x}{2}+\frac {x\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{\sqrt {-\frac {1}{n^2}}\,1{}\mathrm {i}}}\,1{}\mathrm {i}}{4\,n\,\sqrt {-\frac {1}{n^2}}+4{}\mathrm {i}}-\frac {x\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{\sqrt {-\frac {1}{n^2}}\,1{}\mathrm {i}}\,1{}\mathrm {i}}{4\,n\,\sqrt {-\frac {1}{n^2}}-4{}\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + (log(c*x^n)*(-1/n^2)^(1/2))/2)^2,x)

[Out]

x/2 + (x*exp(-a*2i)/(c*x^n)^((-1/n^2)^(1/2)*1i)*1i)/(4*n*(-1/n^2)^(1/2) + 4i) - (x*exp(a*2i)*(c*x^n)^((-1/n^2)
^(1/2)*1i)*1i)/(4*n*(-1/n^2)^(1/2) - 4i)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos ^{2}{\left (a + \frac {\sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )}}{2} \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+1/2*ln(c*x**n)*(-1/n**2)**(1/2))**2,x)

[Out]

Integral(cos(a + sqrt(-1/n**2)*log(c*x**n)/2)**2, x)

________________________________________________________________________________________